﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Mpfr.Structs
{
  public unsafe class mpq_t : IDisposable
  {
    internal __mpq_struct* mpq_ptr;

    public mpq_t()
    {
      mpq_ptr = (__mpq_struct*)Marshal.AllocHGlobal(sizeof(__mpq_struct));
    }

    ~mpq_t()
    {
      Dispose();
    }

    public void Dispose()
    {
      if (mpq_ptr != null)
      {
        Marshal.FreeHGlobal((IntPtr)mpq_ptr);
        mpq_ptr = null;
      }
    }
  }
}
